package com.shangxia.dog.util;

import com.shangxia.dog.base.entity.Admin;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author zhouya24
 * @date 2021/11/18 15:26
 * @apiNote
 */

@Slf4j
public class LoginUtil {

    public static Admin getAdmin() {
        return ((Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal());
    }
}
